<html>

<head>

    <title>Help On LaTeX Spaces and Boxes</title>

    <link rel="stylesheet" type="text/css" title="Help with LaTeX" href="latex.css">

</head>

<body>


<h2>Spaces and Boxes</h2>


<h3>"Visible" Spaces</h3>


<p>You can generate a "visible" space, generally indicated as a

    small, squat "u," and useful in didactic material by using the

    <tt><a href="ltx-342.html">\verb</a></tt> command or the

    <tt><a href="ltx-79.html">verbatim</a></tt> environment.</p>


<h3>Non-breaking Spaces</h3>


<p>To generate a space where you do not want to allow a break

    for a new line use a <tt>~</tt>. For example,</p>



<pre>

  ... in Table~2 and Fig.~3 ...

</pre>


<h3>Controlling Space in Text</h3>


<p>The ends of words and sentences are marked in the input by

    one or more spaces. LaTeX treats multiple spaces as if they

    were a single space. An end of line is also equivalent to a

    space; however, you can end a line <em>without</em> a space by

    using a <tt><a href="ltx-434.html">%</a></tt> (anything

    following the <tt>%</tt> is considered to be a comment). LaTeX

    generally ignores spaces at the beginning of lines.</p>


<p>Paragraphs are delineated by a <em>blank line</em> -- one

    which does not contain even comments (anything following a

    <tt><a href="ltx-434.html">%</a></tt> until the end of a line is

    a comment). See also the

    <tt><a href="ltx-293.html">\par</a></tt> command.</p>


<p>LaTeX leaves extra space after punctuation, such as the

    period which ends a sentence, but, it uses a very simple rule

    (periods end sentences unless they follow a capital letter) so

    sometimes it needs a little help in determining when this is

    required. (However, see

    <tt><a href="frenchsp.html">\frenchspacing</a></tt>.) Use </p>


<ul>

    <li><tt><a href="ltx-431.html">\&lt;space&gt;</a></tt> to

        create an ordinary interword space
    </li>

    <li><tt><a href="ltx-432.html">\@</a></tt> before punctuation

        to force an "end of sentence" space
    </li>

</ul>


<p>It is sometimes necessary to add a little additional space,

    such as between consecutive single and double

    <a href="ltx-433.html">quotation marks</a>. The

    <tt><a href="ltx-185.html">\,</a></tt> command can be used for

    this purpose.</p>


<p>Also see</p>


<ul>

    <li><a href="ltx-430.html">Dashes</a></li>

    <li><a href="ellipses.html">Ellipses</a></li>

    <li><a href="ltx-433.html">Quotation Marks</a></li>

    <li><a href="ltx-118.html">Spacing in Math Mode</a></li>

</ul>


<h3>Spaces after Commands</h3>


<p>Most LaTeX commands consist of a <tt>\</tt> followed by a

    string of letters. The end of such commands is indicated by a

    nonletter, i.e., a number, a punctuation mark, a space, or the

    end of the line. If the command produces text and you want a

    space to follow this text, you cannot just leave a space after

    the command; that space is treated as the end-of-command signal

    and several spaces are equivalent to one in LaTeX. To generate

    a space after a text-producing command you can use

    <tt><a href="ltx-431.html">\&lt;space&gt;</a></tt>.</p>


<p>For example</p>



<pre>

   <tt>I wrote this on <a href="ltx-330.html">\today</a> .</tt>

</pre>


<p>generates "I wrote this on Jul 7, 1995." Note that the

    spaces between <tt>\today</tt> and the period in the input do

    not generate any space in the output. On the other hand,</p>



<pre>

  <tt>\today\ was a good day.</tt>

</pre>


<p>or</p>



<pre>

  <tt>\today \ was a good day.</tt>

</pre>


<p>will both produce "Jul 7, 1995 was a good day." The

    <tt><a href="ltx-431.html">\&lt;space&gt;</a></tt> here is

    necessary to produce space between the date and "was."</p>


<p>An alternatative is to use braces to terminate the command. For

    example, <tt>\today{} was ...</tt> is equivalent to the above.</p>


<h4>Invisible commands</h4>


<p>Some commands do not produce any output text. LaTeX treats

    these as words of zero length and may try to leave spaces both

    before and after this "word" which will generally produce an

    undesirable gap. This can be avoided by attaching these

    commands directly to the preceding word, i.e., leaving no spaces.</p>


<h3>Some commands which create or manipulate space</h3>


<ul>

    <li><tt><a href="ltx-198.html">\addvspace</a></tt></li>

    <li><tt><a href="ltx-206.html">\bigskip</a></tt></li>

    <li><tt><a href="ltx-220.html">\dotfill</a></tt></li>

    <li><tt><a href="ltx-238.html">\hfill</a></tt></li>

    <li><tt><a href="ltx-240.html">\hrulefill</a></tt></li>

    <li><tt><a href="ltx-241.html">\hspace</a></tt></li>

    <li><tt><a href="ltx-266.html">\medskip</a></tt></li>

    <li><tt><a href="ltx-306.html">\rule</a></tt></li>

    <li><tt><a href="ltx-318.html">\smallskip</a></tt></li>

    <li><tt><a href="ltx-345.html">\vfill</a></tt></li>

    <li><tt><a href="ltx-347.html">\vspace</a></tt></li>

</ul>


<p>See also</p>


<ul>

    <li><a href="ltx-118.html">spacing in math mode</a></li>

</ul>


<h3>Boxes</h3>


<p>A box is an object which TeX treats as a single character; it

    is therefore not broken across lines or pages.</p>


<p>The following commands create or manipulate boxes</p>


<ul>

    <li><tt><a href="ltx-226.html">\fbox</a></tt></li>

    <li><tt><a href="ltx-237.html">\framebox</a></tt></li>

    <li><tt><a href="ltx-262.html">\makebox</a></tt></li>

    <li><tt><a href="ltx-265.html">\mbox</a></tt></li>

    <li><tt><a href="ltx-277.html">\newsavebox</a></tt></li>

    <li><tt><a href="ltx-294.html">\parbox</a></tt></li>

    <li><tt><a href="ltx-302.html">\raisebox</a></tt></li>

    <li><tt><a href="ltx-307.html">\savebox</a></tt></li>

    <li><tt><a href="ltx-307.html">\sbox</a></tt></li>

    <li><tt><a href="ltx-337.html">\usebox</a></tt></li>

</ul>


<hr noshade="noshade" size="1">


</body>
</html>